package com.example.springbooteurekaconsumer.service.impl;

import com.example.springbooteurekaconsumer.service.ConsumerService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ConsumerServiceFactoryImpl implements FallbackFactory<ConsumerService> {
    @Override
    public ConsumerService create(Throwable throwable) {

        return new ConsumerService() {
            @Override
            public String getProduct(String name) {
                return "产品为空factory";
            }
        };
    }
}
